fix: getBuildId & failedTestIds mcp tool#323
Conversation
SavioBS629
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 1 inline finding(s). Full report in the PR comment below. Verdict: Passed.
Claude Code PR ReviewPR: #323 • Head: 35b9a51 • Reviewers: stack:code-review SummaryTwo RCA-agent utility bug fixes: Review Table
Findings
Pre-existing (not introduced here, not blocking)
Verdict: PASS — two reasonable bug fixes, no Critical/High issues; add test coverage for |
SavioBS629
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 2 inline finding(s). Full report in the PR comment below. Verdict: Passed.
Claude Code PR ReviewPR: #323 • Head: cb612fc • Reviewers: stack:code-review SummaryAdds a new Review Table
Findings
Notes (not blocking)
Verdict: PASS — no Critical/High issues; build, type-check, and tests pass. The page-cap silent edge case (#1) is the only correctness item worth a follow-up guard. |
SavioBS629
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 2 inline finding(s). Full report in the PR comment below. Verdict: Passed.
| const authHeader = | ||
| "Basic " + Buffer.from(`${username}:${accessKey}`).toString("base64"); | ||
|
|
||
| const response = await fetch(url.toString(), { |
There was a problem hiding this comment.
[Medium] New file uses fetch instead of apiClient
security.md § Dependency Security: "never use fetch … in new code. All outbound requests to BrowserStack APIs go through src/lib/apiClient.ts." Calling fetch directly bypasses apiClient's proxy/CA-agent config, URL validation, and centralized error handling — a user behind a BROWSERSTACK_LOCAL_OPTION proxy or custom CA would have this tool fail while others work.
Suggestion: Route through apiClient.get({ url, headers }). Ideally refactor get-build-id.ts in the same pass; at minimum don't add a new fetch callsite.
Reviewer: stack:code-review
| } | ||
|
|
||
| const data = await response.json(); | ||
| return data.build_id; |
There was a problem hiding this comment.
[Low] Unchecked data.build_id
await response.json() is untyped (any) and data.build_id is returned unchecked. A response body without build_id makes the tool return text: undefined — an invalid content payload rather than a clean error.
Suggestion: Type the response (as { build_id?: string }) and throw a clear error when build_id is missing, so the catch path returns a proper isError result.
Reviewer: stack:code-review
Claude Code PR ReviewPR: #323 • Head: 531a4b8 • Reviewers: stack:code-review SummaryAdds a new Review Table
Findings
Verdict: PASS — no Critical/High issues; auth/multi-tenant discipline, instrumentation, and tests are sound. Before merge, confirm the |
No description provided.